package com.luzhikun.test1;

import com.luzhikun.Service.CityService;
import com.luzhikun.Service.impl.CityServiceImpl;
import com.luzhikun.domain.City;
import com.luzhikun.util.ServiceFactory;

/**
 * @Author Rookie Coder
 * @Description
 * @Date
 **/
public class Test2 {

    public static void main(String[] args) {

        // 通过工厂方法传入被代理类对象，获取代理类对象
       CityService cs= (CityService) ServiceFactory.getService(new CityServiceImpl());

        City city=new City(9,"中京",4);
        Object object=cs.save(city);
        System.out.println(object);

        City byId = cs.getById("1");
        System.out.println(byId);

//        cs.delete("1");

    }


}
